module.exports={
	formatTime
}
function formatTime(date){
	let aa=new Date(date),now=new Date()
	let result
	let year=aa.getFullYear()
	let mon=aa.getMonth()+1
	let day=aa.getDate()
	let time=aa.getHours()+':'+aa.getMinutes()

	let cyear=now.getFullYear()
	let cmon=now.getMonth()+1
	let cday=now.getDate()
	if(year!=cyear){
		// console.log('不是同一年')
		result=year+'年'+mon+'月'+day+'日 '+time
	}else if(mon!=cmon){
		// console.log('不是同一月')
		result=mon+'月'+day+'日 '+time
	}else if(day!=cday){
		let temp=cday-day
		if(temp==1){
			temp='昨天'
			result=temp+' '+time
		}else if(temp==2){
			temp='前天'
			result=temp+' '+time
		}else{
			result=mon+'月'+day+'日 '+time
		}
	}else{
	result=time
}
	return result
}